package com.qiedan.controller.mdy;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qiedan.service.ItemService;
import com.qiedan.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

@RequestMapping("/item")
@RestController
@Slf4j
public class ItemController {

    @Autowired
    ItemService itemService;
    /**
     * 获取商品列表
     * @return
     */
    @RequestMapping(value = "/list",method = RequestMethod.GET)
    public R<Object> itemList(){

        return itemService.getItemList();
    }
    /**
     * 根据商品id获取商品详情
     * @return
     */
    @RequestMapping(value = "/details",method = RequestMethod.GET)
    public R<Object> getItemDetails(Integer iid){
        return itemService.getItemDetails(iid);
    }

}